#ifndef  _DF_FIFO_H
#define  _DF_FIFO_H


#define uint8_t unsigned char
#define uint16_t unsigned int


/*该参数设置接受区大小*/
typedef struct {

    int  read;//读指针
    int  write;//写指针
    int  Count;//缓冲区计数
    int  length;//缓冲区大小
    uint8_t  * buffer;// [RECERIVRSIZE];//接受缓冲区
}Df_FifoStructTypeDef;



typedef Df_FifoStructTypeDef * Df_FifoPointTypeDef;

typedef enum Df_StateTypeDef
{
    Df_StateOk,//成功
    Df_StateErr,//失败
    Df_StateTimeout,//超时
    Df_StateOutOver,//读溢出
    Df_StateInOver,//写溢出
    Df_StateEaserOver//擦除溢出
}Df_StateTypeDef;


Df_StateTypeDef Df_FifoInput(Df_FifoPointTypeDef Pfifo, uint8_t * buf, uint8_t length);
Df_StateTypeDef Df_FifoOutput(Df_FifoPointTypeDef Pfifo, uint8_t * buf, uint8_t length);
Df_StateTypeDef Df_FifoErase(Df_FifoPointTypeDef Pfifo, uint8_t length);
Df_StateTypeDef Df_FifoReset(Df_FifoPointTypeDef Pfifo, uint8_t * buf, uint16_t length);
Df_StateTypeDef Df_FifoOutEaser(Df_FifoPointTypeDef Pfifo, uint8_t * buf, uint8_t length);



#endif /*_DF_FIFO_H*/